package com.onesports.intelligent.k12.polarlight.mapper.sys;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.onesports.intelligent.k12.polarlight.domain.dto.sys.WxQueryDTO;
import com.onesports.intelligent.k12.polarlight.domain.entity.student.UserStudentRel;
import com.onesports.intelligent.k12.polarlight.domain.entity.sys.WxUser;
import com.onesports.intelligent.k12.polarlight.domain.vo.sys.WxQueryVO;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 小程序登录用户
 *
 * @author
 * @since 1.0.0 2022-07-08
 */
@Mapper
public interface WxUserMapper extends BaseMapper<WxUser> {
    /**
     * 平台会员查询
     * @param page
     * @param dto
     * @return
     */
    IPage<WxQueryVO> queryPage(Page<WxQueryVO> page,@Param("dto") WxQueryDTO dto);

    /**
     * 根据WxUserId获取openId
     * @param wxUserId 微信用户id
     * @return openId
     */
    String getOpenIdByWxUserId(@Param("id") String wxUserId);
    /**
     * 根据教练Id获取WxUser
     * @param coachId 教练Iid
     * @return WxUser
     */
    WxUser getWxUserByCoachId(@Param("coachId") String coachId);

    /**
     * 根据用户ID查找指定班级下存在的学员ID集合
     * @param classId
     * @param acc
     * @return
     */
    List<UserStudentRel> getStudentListByAcc(@Param("classId") String classId,
                                             @Param("acc") List<String> acc);

}
